package com.example.springboot.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springboot.entity.Book;
import com.example.springboot.mapper.BookMapper;

@Service
public class BookService extends ServiceImpl<BookMapper,Book>{

    @Autowired
    BookMapper bookMapper;

    public List<Book> selectByState(String state) {
        QueryWrapper<Book> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("state",state);
        return bookMapper.selectList(queryWrapper);
    }

}
